<!-- Vectrics demo layout_admin.jsp -->
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/vectrics.tld"    prefix="vectrics" %>


<%@ page import="org.vectrics.provider.*" %>
<%@ page import="org.vectrics.user.Person" %>
<%@ page import="org.vectrics.user.User" %>
<%@ page import="org.vectrics.hibernate.ThreadProperties" %>
<%

	String onLoad="this.focus();";

	if (request.getParameter("closeWindow") != null) {
		onLoad += "opener.location.reload();window.close();";
	}

	Person person = ThreadProperties.getPerson();
	String userName = "";
	String encodedPassword = "";
	String contextRoot = request.getContextPath();
	if (person != null) {
		userName = person.getUser().getUserName();
		encodedPassword = person.getUser().getPassword();
	}
	String domainId = ThreadProperties.getDomain().getId().toString();
%>

<tiles:useAttribute id="title" name="title" classname="java.lang.String" />
<tiles:useAttribute id="pageHeader" name="pageHeader" classname="java.lang.String" />
<tiles:useAttribute id="selectedMenuItem" name="selectedMenuItem" classname="java.lang.String" />

<html>
	<head>
	    <meta http-equiv="Content-Type" content="text/html; charset:windows-1252">
		<title>Hexacta Resources System</title>
	    <meta http-equiv="pragma" content="no-cache">
	    <link href="/hrs-intranet/custom/main.css" type="text/css" rel="stylesheet">
		<link rel="stylesheet" href="/hrs-intranet/custom/menu1.css" id="css_menu">

  		<script type="text/javascript" src="/recruit/custom/CalendarItem.js"></script>

		<!--  Date Picker Calendar  ********************************************************   -->
	    <link href="/hrs-intranet/custom/calendar/calendar-blue.css" type="text/css" rel="stylesheet">
<!--
	    <link href="/recruit/custom/calendar/calendar-win2k-1.css" type="text/css" rel="stylesheet">
	-->	
		<script type="text/javascript" src="/hrs-intranet/custom/calendar/calendar.js"></script>
		<script type="text/javascript" src="/hrs-intranet/custom/calendar/lang/calendar-en.js"></script>
		<script type="text/javascript" src="/hrs-intranet/custom/calendar/calendar-setup.js"></script>
		<!--  ******************************************************************************   -->


		<script type="text/javascript" src="/hrs-intranet/custom/ajaxtk/xml/AjxXmlDoc.js"></script>
		<script type="text/javascript" src="/hrs-intranet/custom/ajaxtk/core/AjxCore.js"></script>
		<script type="text/javascript" src="/hrs-intranet/custom/ajaxtk/core/AjxEnv.js"></script>
		<script type="text/javascript" src="/hrs-intranet/custom/ajaxtk/core/AjxException.js"></script>
		<script type="text/javascript" src="/hrs-intranet/custom/ajaxtk/core/AjxImg.js"></script>
		<script type="text/javascript" src="/hrs-intranet/custom/ajaxtk/util/AjxCallback.js"></script>
		<script type="text/javascript" src="/hrs-intranet/custom/ajaxtk/util/AjxTimedAction.js"></script>
		<script type="text/javascript" src="/hrs-intranet/custom/ajaxtk/net/AjxPost.js"></script>


	    <script language="JavaScript" src="/hrs-intranet/custom/menu.js"></script>
		<script type="text/javascript" src="/hrs-intranet/custom/js/vectrics.js"></script>
		
		<script type="text/javascript" src="/hrs-intranet/custom/js/EmailTemplate.js"></script>
		<script type="text/javascript" src="/hrs-intranet/custom/js/PersonSearchDiv.js"></script>
		<script type="text/javascript" src="/hrs-intranet/custom/js/LocationSearchDiv.js"></script>
		
		<script type="text/javascript">
			var lastPersonPickParam;
			var lastLocationPickParam;
			log('Intializing personSearchDiv...');

			var personSearchDiv = new PersonSearchDiv();

			var locationSearchDiv = new LocationSearchDiv();

			function callFindLocationMatches() {
				    
				    findLocationMatches('<%=contextRoot%>', '<%=userName%>', '<%=domainId%>', '<%=encodedPassword%>'); 
				    return false;
			}

			function callFindPersonMatches() {
				    
			        findPersonMatches('<%=contextRoot%>', '<%=userName%>', '<%=domainId%>', '<%=encodedPassword%>'); 
			        return false;
		    }

			function pressLocation(evt) {
		    	var charCode = (evt.which) ? evt.which : event.keyCode;
		    	if (charCode == 13) {
		    		callFindLocationMatches();
		    		return false;
		    	}
		    	return true; 
			}
		</script>

	</head>
	
	<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginwidth="0" marginheight="0" 
		onload="<%=onLoad%>" style="background:white url(/hrs-intranet/graphics/back-body.gif) repeat-x;">
        <table>
        	<tr>
        		<td valign="top" width="100%" class="hxMenu">
			        <tiles:insert attribute="banner"/>
			        <vectrics:menu id="flashrecruit-admin" selectedItemId="<%=selectedMenuItem%>"/>
        			<table width="100%" cellpadding="0" cellspacing="0" class="hxContent">
        				<tr> 
			        		<td>
			        	        <table cellpadding="0" cellspacing="0" width="100%">
						        	<tr>
						        		<td>
							        		<img src="/hrs-intranet/graphics/cleardot.gif" width="1" height="10">
						        		</td>
						        		<td>
									    </td>
								    </tr>
						        	<tr>
						        		<td>
							        		<img src="/hrs-intranet/graphics/cleardot.gif" width="4" height="300">
						        		</td>
						        		<td valign="top">
											<h2><bean:message key="<%=pageHeader%>"/></h2>
									        <tiles:insert attribute="body"/>
									    </td>
								    </tr>
						        	<tr>
						        		<td>
						        		</td>
						        		<td valign="top">
									        <tiles:insert attribute="user-buffer"/>
									    </td>
								    </tr>
								</table>
	<%
		// Debug div - needed for log() statements.
		if (CoreServiceLocator.getConfiguration().getJavaScriptDebug()) {
	%>
							<br><font>JavaScript Debug Log</font>
							<!--<div 
								id="debugDiv" 
								style="position:relative; top:10px; left:10px; width:90%; height:250px;background-color:#dddda0; text-align:left; padding:0px;border: solid 1px #339999;z-index:0;overflow:auto;">
							</div>-->
	<%
		}
	%>
						        <tiles:insert attribute="footer"/>
						    </td>
						    
						    <td valign="top">
						    	<h1>&nbsp;</h1>
						    </td>
						</tr>
					</table>
				</td>    
			<!--  
			    <td bgcolor="#BBFFBB" valign="top">
			    	<h1>Demonstration Version</h1>
			    	<p>
			    	<a class="stdLink" 
			    		href="/site/main/product/registration.do"
			    		 onclick="OpenLarge(this.href, 1); return false"
			    		>Register for FlashRecruit Product Announcements</a></p>
			    		<br><br><br>
			    	<img src="/hrs-intranet/graphics/vectrics-support.gif" width="178" height="32">
			    </td>
-->	
			</tr>
		</table>



		
			<!-- The person picker div - hidden until enabled by pick button click -->
			<div  style="visibility: hidden;position:absolute; top:10px; left:10px;
				text-align:left; padding:0px;z-index:100;" id="person_search_div">
				<IFRAME style="LEFT:0px; POSITION: absolute; TOP:0px; WIDTH:100%; HEIGHT:100%;z-index=98"
						src="javascript:a=1;"
					frameBorder="0" scrolling="no">
				</IFRAME>
				<div  style="position:absolute; top:0px; left:0px; height: 100%; width: 100%;
					background-color:#D6D3CE; text-align:left; padding:0px;border: solid 1px #339999;
					z-index:99;">
		
					<table cellpadding="0" cellspacing="0" width="100%">
						<tr>
							<td>
								<table width="100%" cellpadding="0" cellspacing="0">
									<tr>
										<td class="pickerHeaderCell"><font id="person_search_caption" class="pickerHeader"></font></td>
										<td width="20" class="pickerButton">
											<div
												onclick="javascript:personSearchDiv.closePersonDiv();"
												class="pickerButtonDiv">
												<table width="100%"><tr><td>x</td></tr></table>
											</div>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td>
								<div class="pickerFormDiv" id="search_form_div">
									<form accept-charset='UNKNOWN' action='/admin/user/nameSearch'
										enctype='application/x-www-form-urlencoded'>
										<table width="100%" cellpadding="0" cellspacing="0">
											<tr>
												<td valign='TOP'>
													<table cellspacing='0' height='100%'
														width='100%' cellpadding='0'>
														<tr>
															<td width="100%" valign='top'>
																<table width="100%" cellpadding='1' summary='Vectrics Table' cellspacing='1'>
			
																	<tr>
																		<td><font class="pickerFieldLabel">Last Name</font></td>
																		<td><font class="pickerFieldLabel">First Name</font></td>
																		<td><font class="pickerFieldLabel">Phone</font></td>
																		<td><font class="pickerFieldLabel">City</font></td>
																		<td><font class="pickerFieldLabel">State</font></td>
																	</tr>
																	<tr>
																		<td valign='top'>
																			<input id='edit_lastName' value='' class='pickerEditClass' name='lastName'
																				onChange="personSearchDiv.findPersonMatches('<%=contextRoot%>', '<%=userName%>', '<%=domainId%>', '<%=encodedPassword%>');"
																				type='text'>
																		</td>
																		<td valign='top'>
																			<input id='edit_firstName' value='' class='pickerEditClass' name='firstName'
																				onChange="personSearchDiv.findPersonMatches('<%=contextRoot%>', '<%=userName%>', '<%=domainId%>', '<%=encodedPassword%>');"
																				type='text'>
																		</td>
																		<td valign='top'>
																			<input id='edit_phoneNumber' value='' class='pickerEditClass' name='phoneNumber'
																				onChange="personSearchDiv.findPersonMatches('<%=contextRoot%>', '<%=userName%>', '<%=domainId%>', '<%=encodedPassword%>');"
																				type='text'>
																		</td>
																		<td valign='top'>
																			<input id='edit_city' value='' class='pickerEditClass' name='city'
																			onChange="personSearchDiv.findPersonMatches('<%=contextRoot%>', '<%=userName%>', '<%=domainId%>', '<%=encodedPassword%>');"
																			type='text'>
																		</td>
																		<td valign='top'>
																			<input id='edit_state' value='' class='pickerEditClass' name='state'
																			onChange="personSearchDiv.findPersonMatches('<%=contextRoot%>', '<%=userName%>', '<%=domainId%>', '<%=encodedPassword%>');"
																			type='text'>
																		</td>
																	</tr>
																	<tr>
																		<td valign='top' colspan="5">
																			<table cellpadding="0" cellspacing="0">
																				<tr>
																					<td width="80" class="pickerButton">
																						<div
																							onClick="findPersonMatches('<%=contextRoot%>', '<%=userName%>', '<%=domainId%>', '<%=encodedPassword%>'); return false"
																							class="pickerButtonDiv">Search</div>
																					</td>
																					<td width="10"></td>
																					<td width="80" class="pickerButton">
																						<div
																							onClick='clearPersonSearch(); return false'
																							class="pickerButtonDiv">Clear</div>
																					</td>
																				</tr>
																			</table>
			
																		</td>
																	</tr>
																</table>
															</td>
														</tr>
													</table>
												</td>
											</tr>
										</table>
									</form>
								</div>
			
							</td>
						</tr>
						<tr>
							<td>
								<div  style="position:relative; height:260px; width:399;top:0px; left:0px;
									text-align:left; padding:0px;border: solid 1px #339999;
									z-index:110;overflow:auto;" id="person_search_results">
									<font>Search Results</font>
								</div>
							</td>
						</tr>
					</table>
				</div>
			</div>
		


			<!-- The location picker div -->
			
			<div  style="visibility: hidden;position:absolute;  top:10px; left:10px;
				text-align:left; padding:0px;z-index:100;" id="location_search_div">
				<IFRAME style="LEFT:0px; POSITION: absolute; TOP:0px; WIDTH:100%; HEIGHT:100%; z-index=98"
						src="javascript:a=1;"
					frameBorder="0" scrolling="no">
				</IFRAME>
				<div  style="position:absolute; top:0px; left:0px; height: 100%; width: 100%;
					background-color:#D6D3CE; text-align:left; padding:0px;border: solid 1px #339999;
					z-index:99;">
					<table cellpadding="0" cellspacing="0" width="100%">
						<tr>
							<td>
								<table width="100%" cellpadding="0" cellspacing="0">
									<tr>
										<td class="pickerHeaderCell"><font id="location_search_caption" class="pickerHeader"></font></td>
										<td width="20" class="pickerButton">
											<div 
												onclick="javascript:locationSearchDiv.closeLocationDiv();"
												class="pickerButtonDiv">
												<table width="100%"><tr><td>x</td></tr></table>
											</div>
										</td>
									</tr>
								</table>
							</td>
						</tr>
				
				
						<tr>
							<td>
				
								<form accept-charset='UNKNOWN' action='/admin/location/locationSearch' enctype='application/x-www-form-urlencoded'>
									<table width="100%" cellpadding='0' summary='Vectrics Table' cellspacing='0'>
										<tr>
											<td><font class="pickerFieldLabel">Name</font></td>
										</tr>
										<tr>
											<td valign='top'>
												<input id='edit_locationName' value='' class='pickerEditClass' name='locationName'
													onChange="locationSearchDiv.findLocationMatches('<%=contextRoot%>', '<%=userName%>', '<%=domainId%>', '<%=encodedPassword%>');"
                                                    onkeypress="return pressLocation(event);"
													type='text'>
											</td>
										</tr>
										<tr>
											<td valign='top' colspan="1">
												<table cellpadding="0" cellspacing="0">
													<tr>
														<td width="80" class="pickerButton">
															<div
																onClick="findLocationMatches('<%=contextRoot%>', '<%=userName%>', '<%=domainId%>', '<%=encodedPassword%>'); return false"
																class="pickerButtonDiv">Search</div>
														</td>
														<td width="10"></td>
														<td width="80" class="pickerButton">
															<div
																onClick='clearLocationSearch(); return false'
																class="pickerButtonDiv">Clear</div>
														</td>
													</tr>
												</table>
				
											</td>
										</tr>
				
									</table>
								</form>
						    </td>
						</tr>
						<tr>
							<td>
								<div  style="position:relative; height:220px;width:99%;top:0px; left:1%;
									text-align:left; padding:0px;border: solid 1px #339999;
									z-index:101;overflow:auto;" id="location_search_results">
									<font>Search Results</font>
								</div>
							</td>
						</tr>
				
				
					</table>
				</div>			
			</div>

		
	</body>

</html>
